const express = require('express');
const router = express.Router();
const sql = require("../sql/index");
const Banner = require("../sql/collection/Banner");

/**
* @api {get} /api/banner 请求轮播图数据
* @apiName GetApiBanner
* @apiGroup Banner
*   
* @apiSuccessExample { json } Success-Response:
    res.send({
            code: "200",
            message: "轮播图接口",
            data
        })
* @apiSampleRequest /api/banner
* @apiVersion 0.0.0
*/
router.get('/', function (req, res, next) {
    sql.find(Banner, {}, { _id: 0 }).then((data) => {
        res.send({
            code: "200",
            message: "轮播图接口",
            data
        });
    });
});

module.exports = router;
